import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import(/* webpackChunkName: "about" */ '../components/Manager_Login.vue')
  },
  {
    path: '/index',
    name: 'index',
    component: () => import(/* webpackChunkName: "about" */ '../components/index.vue'),
    children:[
      {path:"hello",component: () => import('../components/HelloWorld.vue')},
      {path:'order/orderlist',component:()=>import('../components/zwj/order/orderlist.vue')},
      {path:'order/orderdetails',name:"orderdetails",component:()=>import('../components/zwj/order/orderdetails.vue')},
      {path:'order/map',name:"orderMap",component:()=>import('../components/zwj/order/map.vue')},
      {path:'order/createorder',component:()=>import('../components/zwj/order/createOder.vue')},
      {path:'transportorder/transportorderlist',component:()=>import('../components/zwj/transportorder/transportorderlist.vue')},
      {path:'transportorder/transportOrderDetails',name:"transportOrderDetails",component:()=>import('../components/zwj/transportorder/transportOrderDetails.vue')},
	    {path:"transport-task",component: () => import(/* webpackChunkName: "about" */ '../components/ldl/Transport-Task.vue')},
      {path:"detail",name:"detail",component: () => import(/* webpackChunkName: "about" */ '../components/ldl/Transpaort-Task-Detail.vue')},
      {path:"Vehicle/VehicleIndex",component: () => import(/* webpackChunkName: "about" */ '../components/wj/Vehicle/VehicleIndex.vue')},
      {path:"Vehicle/ShowDetails",name:"ShowDetails",component: () => import(/* webpackChunkName: "about" */ '../components/wj/Vehicle/ShowDetails.vue')},
      {path:"Vehicle/TruckTypeIndex",component: () => import(/* webpackChunkName: "about" */ '../components/wj/Vehicle/TruckTypeIndex.vue')},
      {path:"Vehicle/TransportLineTypeIndex",component: () => import(/* webpackChunkName: "about" */ '../components/wj/Vehicle/TransportLineTypeIndex.vue')},
      {path:"Vehicle/FleetIndex",component: () => import(/* webpackChunkName: "about" */ '../components/wj/Vehicle/FleetIndex.vue')},
      {path:"Vehicle/TruckDriverIndex",component: () => import(/* webpackChunkName: "about" */ '../components/wj/Vehicle/TruckDriverIndex.vue')},
      {path:"Vehicle/ShowTruckDriver",name:"ShowTruckDriver",component: () => import(/* webpackChunkName: "about" */ '../components/wj/Vehicle/ShowTruckDriver.vue')},
      {path:"GoodsType",component:()=>import('../components/zhh/GoodsType.vue')},
      {path:"driver",component:()=>import('../components/zhh/driver.vue')},
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
})

router.afterEach((to,from)=>{
  if(to.query.top){
  let menus=to.query.top.split(",");
 console.log(menus)
  router.app.$store.commit("settop",menus);
  }
})

export default router
